In [2]:
using Revise, NeuroAnalysis, Interact
rate = slider(0:100,value=50,label="Spike Rate")
duration = slider(0:5000,value=1000,label="Spike Train Duration")
refreshperiod = slider(1:5,value=2,label="Spike Refresh Period")
ntrain = slider(1:1000,value=100,label="Number of Spike Train")
vbox(rate,duration,refreshperiod,ntrain)


Out[2]:

Homogeneous Poisson Process, where instantaneous firing rate is constant

Inter-Spike-Interval Exponential Distribution Method


In [3]:
sts = [poissonspike(rate[],duration[],rp=refreshperiod[]) for _ in 1:ntrain[]]
plotspiketrain(sts,timeline=[0,duration[]])


Out[3]:
0 250 500 750 1000 0 25 50 75 100 Time (ms) Trial SpikeTrain TimeLine

Instantaneous Firing Rate Method


In [4]:
sts = [poissonspike(t->rate[],duration[],rp=refreshperiod[]) for _ in 1:ntrain[]]
plotspiketrain(sts,timeline=[0,duration[]])


Out[4]:
0 250 500 750 1000 0 25 50 75 100 Time (ms) Trial SpikeTrain TimeLine

Inhomogeneous Poisson Process, where instantaneous firing rate is changing


In [5]:
sts = [poissonspike(t->rate[]*(sin(0.05t)+1),duration[],rp=refreshperiod[]) for _ in 1:ntrain[]]
plotspiketrain(sts,timeline=[0,duration[]])


Out[5]:
0 250 500 750 1000 0 25 50 75 100 Time (ms) Trial SpikeTrain TimeLine

In [ ]: